Skip to content

feat: bump lean version#176

Open
dhsorens wants to merge 4 commits intomasterfrom
dhsorens/bump_to_4.29.0-rc6
Open

feat: bump lean version#176
dhsorens wants to merge 4 commits intomasterfrom
dhsorens/bump_to_4.29.0-rc6

Conversation

@dhsorens
Copy link
Copy Markdown
Collaborator

@dhsorens dhsorens commented Mar 28, 2026

Thanks Claude! Bumps to v4.29.0-rc6

CHANGELOG

  • Lean v4.28.0v4.29.0-rc6; Mathlib v4.28.0v4.29.0-rc6; ExtTreeMapLemmas v4.28.0-patch-1v4.29.0-rc6 (lean-toolchain, lakefile.lean, lake-manifest.json).
  • 36 Lean files touched: mostly tactic/instance fixes (rwerw, Quotient.eqQuotient.sound on quotient descent lemmas, stricter simp → dropped unused args, simp (config := { failIfUnchanged := false }), higher maxHeartbeats / maxSteps where needed).
  • set_option backward.isDefEq.respectTransparency false (file-scoped): Fields/Binary/Tower/Concrete/{Field,Algebra,Basis}.lean, Fields/Binary/Tower/Equiv.lean; scoped on theorems in Tower/Abstract/Basis.lean, Tower/Support/Preliminaries.lean, ToMathlib/MvPolynomial/Equiv.lean (support_finSuccEquivNth).
  • @[reducible] added on various class-valued defs (e.g. Data/RingTheory/AlgebraTower.lean toAlgebra + AlgebraTowerEquiv algebra defs; abstract/concrete binary tower algebra/module/scalar-tower helpers; Concrete/Core mkAddCommGroup/mkRing/mkDivisionRing/mkField; Concrete/Field liftConcreteBTField).
  • noncomputable: CBivariate.ofPoly; CMvPolynomial.degreeOf / degrees / vars; getBTFResult; Fintype instances for ConcreteBTField k and test BTF₃.
  • Lawful.lean / Unlawful.lean: set_option allowUnsafeReducibility true + attribute [local reducible] instDecidableEqOfLawfulBEq; mem_iff / zero_eq_empty proof tweaks.
  • Mathlib renames in proofs: Nat.cast_leENat.coe_le_coe (ENat floor lemma); Array.sum_eq_sum_toListArray.sum_toList; List.extract_eq_drop_takeList.extract_eq_take_drop.
  • ENNReal.mul_inv_rev_ENNReal: statement now only ha : a ≠ 0 (drops hb); proof via ENNReal.mul_inv.
  • Binary tower / GHASH / NTT / multilinear / mv poly equiv: assorted erw, convert, conv, and simp list edits; NovelPolynomialBasis: degree_Xⱼ WithBot cast path reworked, redundant CoeffVecSpace AddCommGroup instance removed, toCoeffsVec.map_smul' unfolded; Split.lean unique_linear_decomposition_succ and split_algebraMap_eq_zero_x proofs reworked.
  • Multivariate/MvPolyEquiv/Instances.lean: Finsupp.single/single_eq_* steps adjusted for new simp behavior.
  • Rename.lean: toFinsupp_zero finishes with Vector.getElem_zero.
  • Tests Univariate/Linear.lean: test-local BEq defs @[reducible]; LawfulBEq proofs use erw on beq unfolds.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 28, 2026

🤖 Gemini PR Summary

Updates the repository toolchain and dependencies to Lean version v4.29.0-rc6.

Toolchain and Dependencies

  • Bumps Lean, Mathlib, and ExtTreeMapLemmas to v4.29.0-rc6.
  • Updates lakefile.lean and lake-manifest.json to match the new toolchain version.

Tactic and Proof Maintenance

  • Tactic Adjustments: Updates numerous proofs to accommodate stricter unification and simplifier behavior in v4.29. This includes replacing rw with erw and transitioning from Quotient.eq to Quotient.sound for quotient descent lemmas.
  • Mathlib Alignment: Updates lemma references to reflect Mathlib renames:
    • Nat.cast_leENat.coe_le_coe
    • Array.sum_eq_sum_toListArray.sum_toList
    • List.extract_eq_drop_takeList.extract_eq_take_drop
  • Lemma Refinement: Simplifies the statement of ENNReal.mul_inv_rev_ENNReal by removing the hb : b ≠ 0 hypothesis.
  • Resource Management: Increases maxHeartbeats and maxSteps for resource-intensive proofs (e.g., multilinearBasis_apply).

Typeclass Resolution and Reducibility

  • Reducibility Updates: Adds @[reducible] to core class-valued definitions to assist instance synthesis, including toAlgebra, AlgebraTowerEquiv, and various mkField/mkRing constructors.
  • Definitional Equality: Disables transparency checks via set_option backward.isDefEq.respectTransparency false in files such as Tower/Concrete/Field.lean and Tower/Equiv.lean to facilitate complex definitional equality checks.
  • Unsafe Reducibility: Enables allowUnsafeReducibility and local reducibility for instDecidableEqOfLawfulBEq in Lawful.lean and Unlawful.lean.

Logic and Computability

  • Computability: Marks polynomial degree functions (degreeOf, vars, degrees) and certain Fintype instances for binary towers as noncomputable.
  • Proof Refactors: Reworks proofs in NovelPolynomialBasis.lean (specifically degree_Xⱼ cast paths), Split.lean, and Multivariate/MvPolyEquiv/Instances.lean to align with new simp behavior and instance resolution logic.

Note on Discrepancies:
The draft summary identifies a "sweeping upgrade of the Multivariate polynomial library" involving universe generalization (Type to Type*). However, the provided PR body and changelog do not explicitly mention universe polymorphism changes, citing only tactic, instance, and simp adjustments for those files.


Statistics

Metric Count
📝 Files Changed 42
Lines Added 318
Lines Removed 298

Lean Declarations

✏️ **Removed:** 20 declaration(s)
  • def binaryTowerModule {l r : ℕ} (h_le : l ≤ r) : in CompPoly/Fields/Binary/Tower/Concrete/Algebra.lean
  • def mkAddCommGroupInstance {k : ℕ} : AddCommGroup (ConcreteBTField k) in CompPoly/Fields/Binary/Tower/Concrete/Core.lean
  • instance instFintype {k : ℕ} : Fintype (ConcreteBTField k) in CompPoly/Fields/Binary/Tower/Concrete/Field.lean
  • def NZConst {n : ℕ} {R : Type} [Zero R] (p : Lawful n R) : Prop in CompPoly/Multivariate/Lawful.lean
  • def mkFieldInstance {k : ℕ} (props : ConcreteBTFieldProps k) : Field (ConcreteBTField k) where in CompPoly/Fields/Binary/Tower/Concrete/Core.lean
  • def AlgebraTowerEquiv.toAlgebraOverRight (e : AlgebraTowerEquiv A B) (i j : ι) in CompPoly/Data/RingTheory/AlgebraTower.lean
  • def liftConcreteBTField (k : ℕ) (prevBTFResult : ConcreteBTFStepResult (k in CompPoly/Fields/Binary/Tower/Concrete/Field.lean
  • def isScalarTower_succ_right (l r : ℕ) (h_le : l ≤ r) in CompPoly/Fields/Binary/Tower/Concrete/Basis.lean
  • def getBTFResult (k : ℕ) : ConcreteBTFStepResult k in CompPoly/Fields/Binary/Tower/Concrete/Field.lean
  • def BTField.isScalarTower_succ_right (l r : ℕ) (h_le : l ≤ r) in CompPoly/Fields/Binary/Tower/Abstract/Basis.lean
  • def binaryAlgebraTower {l r : ℕ} (h_le : l ≤ r) : Algebra (BTField l) (BTField r) in CompPoly/Fields/Binary/Tower/Abstract/Algebra.lean
  • def degreeOf {R : Type} {n : ℕ} [Zero R] (i : Fin n) : CMvPolynomial n R → ℕ in CompPoly/Multivariate/CMvPolynomial.lean
  • def mkDivisionRingInstance {k : ℕ} (props : ConcreteBTFieldProps k) : in CompPoly/Fields/Binary/Tower/Concrete/Core.lean
  • def mkRingInstance {k : ℕ} (props : ConcreteBTFieldProps k) : Ring (ConcreteBTField k) where in CompPoly/Fields/Binary/Tower/Concrete/Core.lean
  • def ConcreteBTFieldAlgebra {l r : ℕ} (h_le : l ≤ r) : in CompPoly/Fields/Binary/Tower/Concrete/Algebra.lean
  • def degrees {n : ℕ} {R : Type} [Zero R] (p : CMvPolynomial n R) : Multiset (Fin n) in CompPoly/Multivariate/CMvPolynomial.lean
  • def AlgebraTowerEquiv.toAlgebraOverLeft (e : AlgebraTowerEquiv A B) (i j : ι) in CompPoly/Data/RingTheory/AlgebraTower.lean
  • def binaryTowerModule {l r : ℕ} (h_le : l ≤ r) : Module (BTField l) (BTField r) in CompPoly/Fields/Binary/Tower/Abstract/Algebra.lean
  • def ofPoly {R : Type*} [BEq R] [LawfulBEq R] [Nontrivial R] [Semiring R] in CompPoly/Bivariate/ToPoly.lean
  • def vars {n : ℕ} {R : Type} [Zero R] (p : CMvPolynomial n R) : Finset (Fin n) in CompPoly/Multivariate/CMvPolynomial.lean
✏️ **Added:** 1 declaration(s)
  • def NzConst {n : ℕ} {R : Type*} [Zero R] (p : Lawful n R) : Prop in CompPoly/Multivariate/Lawful.lean
✏️ **Affected:** 50 declaration(s) (line number changed)
  • lemma bind₁_eq_aeval {n m : ℕ} {R : Type*} [CommSemiring R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L173 to L173
  • def coeff {R : Type*} {n : ℕ} [Zero R] (m : CMvMonomial n) (p : CMvPolynomial n R) : R in CompPoly/Multivariate/CMvPolynomial.lean moved from L59 to L59
  • def aeval {n : ℕ} {R σ : Type*} [CommSemiring R] [CommSemiring σ] [Algebra R σ] in CompPoly/Multivariate/Operations.lean moved from L126 to L126
  • def support {R : Type*} {n : ℕ} [Zero R] (p : CMvPolynomial n R) : Finset (Fin n →₀ ℕ) in CompPoly/Multivariate/CMvPolynomial.lean moved from L138 to L138
  • abbrev MonoR (n : ℕ) (R : Type*) in CompPoly/Multivariate/CMvMonomial.lean moved from L167 to L167
  • lemma zero_eq_empty : (0 : Lawful n R) = ∅ in CompPoly/Multivariate/Lawful.lean moved from L114 to L116
  • abbrev Unlawful (n : ℕ) (R : Type*) : Type _ in CompPoly/Multivariate/Unlawful.lean moved from L34 to L34
  • lemma not_mem_zero : x ∉ (0 : Unlawful n R) in CompPoly/Multivariate/Unlawful.lean moved from L148 to L150
  • lemma foldl_add_comm {β : Type*} [AddCommMonoid β] {k : ℕ} in CompPoly/Multivariate/Operations.lean moved from L359 to L359
  • lemma eval₂Hom_apply {S : Type*} [CommSemiring S] in CompPoly/Multivariate/MvPolyEquiv/Eval.lean moved from L98 to L98
  • def leadingCoeff {n : ℕ} {R : Type*} [Zero R] [MonomialOrder n] in CompPoly/Multivariate/Operations.lean moved from L85 to L85
  • lemma sumToIter_eq {n : ℕ} {R : Type*} [CommSemiring R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L378 to L378
  • lemma fromCMvPolynomial_monomial {k : ℕ} {R : Type*} [CommSemiring R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L244 to L244
  • lemma fromCMvPolynomial_X {k : ℕ} {R : Type*} [CommSemiring R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L271 to L271
  • def restrictDegree {n : ℕ} {R : Type*} [BEq R] [LawfulBEq R] [Zero R] in CompPoly/Multivariate/CMvPolynomial.lean moved from L211 to L211
  • def monomial {n : ℕ} {R : Type*} [BEq R] [LawfulBEq R] [Zero R] in CompPoly/Multivariate/CMvPolynomial.lean moved from L157 to L157
  • lemma X_eq_monomial {k : ℕ} {R : Type*} [CommSemiring R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L222 to L222
  • def X {n : ℕ} {R : Type*} [Zero R] [One R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/CMvPolynomial.lean moved from L53 to L53
  • lemma isNoZeroCoef_zero : isNoZeroCoef (n in CompPoly/Multivariate/Unlawful.lean moved from L151 to L153
  • def totalDegree {R : Type*} {n : ℕ} [Zero R] : CMvPolynomial n R → ℕ in CompPoly/Multivariate/CMvPolynomial.lean moved from L142 to L142
  • lemma degreeOf_eq_count_degrees {n : ℕ} {R : Type*} [Zero R] in CompPoly/Multivariate/CMvPolynomial.lean moved from L169 to L169
  • lemma sumToIter_add {n : ℕ} {R : Type*} [CommSemiring R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L398 to L398
  • def leadingTerm {n : ℕ} {R : Type*} [Zero R] [BEq R] [LawfulBEq R] [MonomialOrder n] in CompPoly/Multivariate/Operations.lean moved from L75 to L75
  • def rename {n m : ℕ} {R : Type*} [Zero R] [Add R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L207 to L207
  • lemma foldl_eq_sum {β : Type*} [AddCommMonoid β] in CompPoly/Multivariate/MvPolyEquiv/Instances.lean moved from L190 to L190
  • lemma filter_get {R : Type*} [BEq R] [LawfulBEq R] {v : R} {m : CMvMonomial n} (a : Unlawful n R) : in CompPoly/Multivariate/Unlawful.lean moved from L225 to L227
  • def coeff {R : Type*} {n : ℕ} [Zero R] (m : CMvMonomial n) (p : Unlawful n R) : R in CompPoly/Multivariate/Unlawful.lean moved from L221 to L223
  • lemma list_foldl_add_comm {β K V : Type*} [AddCommMonoid β] in CompPoly/Multivariate/Operations.lean moved from L348 to L348
  • lemma eval₂_equiv {S : Type*} {p : CMvPolynomial n R} [CommSemiring S] {f : (R →+* S)} in CompPoly/Multivariate/MvPolyEquiv/Eval.lean moved from L25 to L25
  • def eval₂Hom {S : Type*} [CommSemiring S] in CompPoly/Multivariate/MvPolyEquiv/Eval.lean moved from L89 to L89
  • def leadingMonomial {n : ℕ} {R : Type*} [Zero R] [MonomialOrder n] in CompPoly/Multivariate/Operations.lean moved from L58 to L58
  • def C {n : ℕ} {R : Type*} [BEq R] [LawfulBEq R] [Zero R] (c : R) : CMvPolynomial n R in CompPoly/Multivariate/CMvPolynomial.lean moved from L49 to L49
  • lemma list_foldl_add_comm {β K V : Type*} [AddCommMonoid β] in CompPoly/Multivariate/Rename.lean moved from L36 to L36
  • lemma add_getD? [AddZeroClass R] {m : CMvMonomial n} {p q : Unlawful n R} : in CompPoly/Multivariate/Unlawful.lean moved from L229 to L231
  • def eval {R : Type*} {n : ℕ} [CommSemiring R] : (Fin n → R) → CMvPolynomial n R → R in CompPoly/Multivariate/CMvPolynomial.lean moved from L133 to L133
  • lemma foldl_add_comm' {β : Type*} [AddCommMonoid β] {k : ℕ} in CompPoly/Multivariate/Rename.lean moved from L48 to L48
  • def restrictTotalDegree {n : ℕ} {R : Type*} [BEq R] [LawfulBEq R] [Zero R] in CompPoly/Multivariate/CMvPolynomial.lean moved from L203 to L203
  • def restrictBy {n : ℕ} {R : Type*} [BEq R] [LawfulBEq R] [Zero R] in CompPoly/Multivariate/CMvPolynomial.lean moved from L194 to L194
  • lemma toList_pairs_monomial_coeff {β : Type*} [AddCommMonoid β] in CompPoly/Multivariate/MvPolyEquiv/Instances.lean moved from L179 to L179
  • abbrev CMvPolynomial (n : ℕ) (R : Type*) [Zero R] : Type _ in CompPoly/Multivariate/CMvPolynomial.lean moved from L42 to L42
  • lemma totalDegree_equiv {S : Type*} {p : CMvPolynomial n R} [CommSemiring S] : in CompPoly/Multivariate/MvPolyEquiv/Eval.lean moved from L56 to L56
  • def bind₁ {n m : ℕ} {R : Type*} [CommSemiring R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L166 to L166
  • lemma coeff_sumToIter {n : ℕ} {R : Type*} [CommSemiring R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L389 to L389
  • lemma degreeOf_equiv {S : Type*} {p : CMvPolynomial n R} [CommSemiring S] : in CompPoly/Multivariate/MvPolyEquiv/Eval.lean moved from L60 to L60
  • def evalMonomial {R : Type*} {n : ℕ} [CommSemiring R] : (Fin n → R) → CMvMonomial n → R in CompPoly/Multivariate/CMvMonomial.lean moved from L198 to L198
  • def Lawful (n : ℕ) (R : Type*) [Zero R] : Type _ in CompPoly/Multivariate/Lawful.lean moved from L28 to L30
  • def eval₂ {R S : Type*} {n : ℕ} [Semiring R] [CommSemiring S] : in CompPoly/Multivariate/CMvPolynomial.lean moved from L128 to L128
  • theorem ENNReal.mul_inv_rev_ENNReal {a b : ℕ} (ha : a ≠ 0) : in CompPoly/Data/Nat/Bitwise.lean moved from L52 to L52
  • def sumToIter {n : ℕ} {R : Type*} [Zero R] [Add R] [BEq R] [LawfulBEq R] in CompPoly/Multivariate/Operations.lean moved from L216 to L216
  • lemma zero_eq_empty [BEq R] [LawfulBEq R] : (0 : Unlawful n R) = ∅ in CompPoly/Multivariate/Unlawful.lean moved from L138 to L138

sorry Tracking

  • No sorrys were added, removed, or affected.

🎨 **Style Guide Adherence**

This review identifies 46 style guide violations in the provided diff. Following the instructions for more than 20 violations, they are grouped by rule below.

Rule Violations

  • "Put spaces on both sides of :, :=, and infix operators."

    • Count: 21 violations.
    • Representative Examples:
      • CompPoly/Data/RingTheory/AlgebraTower.lean:44: (i:=i) (j:=j) (h:=h) should be (i := i) (j := j) (h := h).
      • CompPoly/Data/RingTheory/AlgebraTower.lean:102: hjRingEquiv: RingEquiv should be hjRingEquiv : RingEquiv.
      • CompPoly/Fields/Binary/Tower/Abstract/Split.lean:314: (l:=k-1) should be (l := k - 1).
  • "Functions: Prefer fun x ↦ ... over λ x, ...."

    • Count: 11 violations.
    • Representative Examples:
      • CompPoly/Fields/Binary/Tower/Abstract/Basis.lean:183: (fun i => should be (fun i ↦.
      • CompPoly/Fields/Binary/Tower/Abstract/Split.lean:208: fun q hq => should be fun q hq ↦.
      • CompPoly/Multivariate/CMvPolynomial.lean:128: fun f vs p => should be fun f vs p ↦.
  • "Use manual dot notation for logical connectives and equality (e.g., And.intro, Eq.refl, Iff.mp)."

    • Count: 5 violations.
    • Representative Examples:
      • CompPoly/Bivariate/ToPoly.lean:177: (toImpl_add ...).symm should be Eq.symm (toImpl_add ...).
      • CompPoly/Data/Nat/Bitwise.lean:42: ENNReal.coe_le_coe.trans should be Iff.trans ENNReal.coe_le_coe.
      • CompPoly/Multivariate/Restrict.lean:152: (Array.sum_toList ...).symm should be Eq.symm (Array.sum_toList ...).
  • "Avoid using ; to separate tactics unless writing short, single-line tactic sequences."

    • Count: 6 violations.
    • Representative Examples:
      • CompPoly/Fields/Binary/Tower/Abstract/Split.lean:223: intro p; simp only ... should place tactics on separate lines.
      • CompPoly/Fields/Binary/Tower/Concrete/Core.lean:1344: rw ...; simp ...; simp ... should place tactics on separate lines.
      • tests/CompPolyTests/Univariate/Linear.lean:20: intro a; erw ...; simp should place tactics on separate lines.
  • "Prefer placing hypotheses to the left of the colon (e.g., (h : P) : Q) rather than using arrows (: P → Q) when the proof introduces them."

    • Count: 2 violations.
    • Lines:
      • CompPoly/Data/RingTheory/AlgebraTower.lean:171: theorem towerAlgebraMap_assoc : ∀ r mid l : ℕ, (h_l_le_mid : l ≤ mid) → (h_mid_le_r : mid ≤ r) → ...
      • CompPoly/Fields/Binary/Tower/Abstract/Basis.lean:182: theorem multilinearBasis_apply (r : ℕ) : ∀ l : ℕ, (h_le : l ≤ r) → ...
  • "Delimiters: Avoid parentheses where possible... Avoid empty lines inside definitions or proofs."

    • Count: 1 violation.
    • Line:
      • CompPoly/Univariate/Quotient/Core.lean:744: ( Quotient.mk ( Raw.instSetoidCPolynomial ) p ) violates the rule against unnecessary parentheses and the general formatting guideline against extra spaces inside delimiters.

📄 **Per-File Summaries**
  • CompPoly/Bivariate/ToPoly.lean: This change marks the ofPoly definition as noncomputable and refines several existing proofs to improve tactic robustness, specifically by substituting rw with erw and adjusting congruence applications. No new theorems are introduced, and no sorry or admit placeholders were added.
  • CompPoly/Data/Nat/Bitwise.lean: This update simplifies the proof of ENNReal.mul_inv_rev_ENNReal by utilizing existing ENNReal lemmas, which allows for the removal of an unnecessary non-zero hypothesis. Additionally, it updates a lemma reference in ENat.le_floor_NNReal_iff to maintain consistency with the current library. No sorry or admit placeholders were introduced.
  • CompPoly/Data/Polynomial/Frobenius.lean: This change modifies the proof of degree_dvd_of_irreducible_dvd_X_pow_card_pow_sub_X by replacing a standard rewrite with erw to resolve a definitional equality involving the cardinality of units. No new theorems or definitions are introduced, and the file contains no sorry or admit placeholders.
  • CompPoly/Data/RingTheory/AlgebraTower.lean: This change marks AlgebraTower.toAlgebra and related definitions in AlgebraTowerEquiv as reducible. This is intended to improve typeclass resolution by allowing the elaborator to more easily unfold these definitions when searching for Algebra instances within a tower.
  • CompPoly/Data/Vector/Basic.lean: This change modifies the proof of the theorem tail_cons by updating a lemma name in a simplification tactic to match current library naming conventions. No new theorems or definitions are introduced, and the file contains no sorry placeholders.
  • CompPoly/Fields/Binary/AdditiveNTT/Correctness.lean: This change refines the proof of the additiveNTT_correctness theorem by updating the simplification and rewrite strategy for base_coeffsBySuffix. It replaces a standard simp/rw sequence with explicit erw calls to ensure the correctness proof remains robust, without introducing any new definitions or sorry placeholders.
  • CompPoly/Fields/Binary/AdditiveNTT/Impl.lean: This change marks the Fintype instance for the binary tower field BTF₃ as noncomputable. It does not introduce new theorems or definitions and contains no sorry placeholders.
  • CompPoly/Fields/Binary/AdditiveNTT/Intermediate.lean: This change modifies existing proofs by replacing rw with erw in two lemmas to resolve unification issues during rewriting. No new theorems, definitions, or sorry placeholders are introduced.
  • CompPoly/Fields/Binary/AdditiveNTT/NovelPolynomialBasis.lean: The changes refactor and stabilize several proofs related to polynomial degrees and linear maps between coefficient spaces, specifically improving the handling of natural number casts and submodule scalar multiplication. The modifications streamline existing proofs without introducing new definitions, theorems, or sorry placeholders.
  • CompPoly/Fields/Binary/BF128Ghash/Basic.lean: This change refines the proof of the root_satisfies_poly theorem by adjusting the simplification and rewriting tactics used to evaluate the field's minimal polynomial. Specifically, it replaces a portion of the simp call with erw to ensure that polynomial evaluation lemmas for powers and variables are applied correctly.
  • CompPoly/Fields/Binary/Common.lean: This change refactors the proof of toPoly_128_extend_256 by replacing a complex simp call with a more explicit and structured argument. It utilizes Nat.testBit_lt_two_pow directly to handle bitwise logic, improving the proof's clarity without introducing new theorems or sorry placeholders.
  • CompPoly/Fields/Binary/Tower/Abstract/Basis.lean: This PR refines and fixes proofs related to power bases and multilinear bases in binary tower fields by addressing issues with instance resolution and definitional equality. Key changes include using erw and specific compiler options (backward.isDefEq.respectTransparency) to bridge gaps where simp failed, and increasing resource limits for the complex multilinearBasis_apply theorem. No new theorems were added, and no sorry or admit placeholders were introduced.
  • CompPoly/Fields/Binary/Tower/Abstract/Split.lean: This PR refines the proofs for the linear decomposition and splitting of binary tower field elements, primarily by improving the handling of algebraic mappings and dependent type casts (eqRec). The changes replace implicit convert tactics with more explicit derivation steps in unique_linear_decomposition_succ and update the simplification path for embeddings in split_algebraMap_eq_zero_x. No new theorems or sorry placeholders are introduced.
  • CompPoly/Fields/Binary/Tower/Concrete/Basis.lean: This change refactors and optimizes proofs related to basis constructions in the concrete binary tower field, notably by marking isScalarTower_succ_right as reducible and adjusting definitional equality transparency settings. The PR streamlines the proofs of PowerBasis.cast_basis_succ_of_eq_rec_apply and multilinearBasis_apply and introduces no new theorems or sorry placeholders.
  • CompPoly/Fields/Binary/Tower/Concrete/Core.lean: This PR refactors existing proofs in ConcreteBTField for better maintainability and modifies several instance-generating definitions (such as mkFieldInstance and mkRingInstance) by marking them as @[reducible]. The changes focus on streamlining tactic use—replacing complex simp calls with more direct erw and show statements—without introducing new theorems or sorry placeholders.
  • CompPoly/Fields/Binary/Tower/Concrete/Field.lean: This change refines the concrete binary tower field implementation by marking several core definitions and Fintype instances as noncomputable or @[reducible]. It also adjusts the backward.isDefEq.respectTransparency setting to ensure proper definitional equality behavior during field construction; no new theorems or sorry placeholders are introduced.
  • CompPoly/Fields/Binary/Tower/Equiv.lean: This Lean file updates the environment configuration by setting the backward.isDefEq.respectTransparency option to false. This change is intended to facilitate definitional equality checks and unification during the proofs of equivalences between abstract and concrete binary tower constructions.
  • CompPoly/Fields/Binary/Tower/Support/Preliminaries.lean: This change modifies the proof environment for two theorems, linear_form_of_elements_in_adjoined_commring and its uniqueness counterpart, by disabling transparency checks during definitional equality. This adjustment is likely intended to resolve unification or elaboration issues occurring within the proofs of these theorems. No new theorems or definitions are introduced, and there are no sorry placeholders.
  • CompPoly/Multilinear/Basic.lean: This change refines the proofs of mobius_apply_zeta_apply_eq_id and zeta_apply_mobius_apply_eq_id by removing redundant simplification lemmas from their respective simp blocks. No new theorems or definitions are introduced, and no sorry placeholders were added.
  • CompPoly/Multilinear/Equiv.lean: This change streamlines the proofs of map_add' and map_smul' within the linearEquivMvPolynomialDeg1 definition by replacing redundant conv blocks and simp sequences with more direct rewrites. The modifications simplify the internal logic for mapping coefficients between multilinear and multivariate polynomials without introducing new definitions or theorems.
  • CompPoly/Multivariate/CMvMonomial.lean: This change generalizes the universe level of the type parameter R from Type to Type* across the MonoR and evalMonomial definitions. This ensures that these multivariate monomial structures and their evaluation functions can be used with types residing in any universe level.
  • CompPoly/Multivariate/CMvPolynomial.lean: The changes generalize the universe levels of ring types R and S by replacing Type with Type* across numerous definitions and lemmas. Additionally, the definitions degreeOf, degrees, and vars are marked as noncomputable. No new theorems were introduced and no sorry placeholders were added.
  • CompPoly/Multivariate/CMvPolynomialEvalLemmas.lean: This change generalizes the universe level of the commutative semiring type R by replacing Type with Type*. It maintains the existing lemmas without introducing new definitions, theorems, or sorry placeholders.
  • CompPoly/Multivariate/FinSuccEquiv.lean: This change generalizes the universe level of the ring type R by replacing Type with Type* in the variable declaration. It does not introduce new theorems or definitions.
  • CompPoly/Multivariate/Lawful.lean: This update generalizes Lawful multivariate polynomials to be universe-polymorphic and improves the reducibility of decidable equality instances to facilitate automation. It also standardizes naming conventions for constant checks and makes minor tactical adjustments to existing proofs.
  • CompPoly/Multivariate/MvPolyEquiv/Core.lean: This change generalizes the universe level of the coefficient ring and refines the proofs for the equivalence between CMvPolynomial and MvPolynomial. It modifies existing proofs to use more explicit lemma applications for ExtTreeMap operations and contains no sorry or admit placeholders.
  • CompPoly/Multivariate/MvPolyEquiv/Eval.lean: This change generalizes the universe levels for the types R and S by replacing Type with Type* in several lemmas and definitions. These modifications increase the polymorphism of multivariate polynomial evaluation tools, such as eval₂_equiv and eval₂Hom, without altering the underlying logic or proofs.
  • CompPoly/Multivariate/MvPolyEquiv/Instances.lean: This change generalizes universe levels for ring and type variables from Type to Type* and updates the proof of map_mul to be more robust against beta-reduction changes in newer Lean versions. The modifications ensure the internal definition of F₃ is correctly handled during rewriting, without introducing any sorry or admit placeholders.
  • CompPoly/Multivariate/Operations.lean: This change generalizes the universe levels for types (such as the coefficient ring $R$) across various multivariate polynomial definitions and lemmas by replacing Type with Type*. These updates increase the library's flexibility by allowing operations like leadingMonomial, aeval, and bind₁ to be used in higher type universes.
  • CompPoly/Multivariate/Rename.lean: This update generalizes universe levels from Type to Type* across several declarations and modifies the proof of toFinsupp_zero by adding an explicit terminal step. No new theorems, definitions, or sorry placeholders are introduced.
  • CompPoly/Multivariate/Restrict.lean: This update introduces universe polymorphism for type parameters and refactors a proof to use the renamed Array.sum_toList lemma. No new theorems or sorry placeholders are added.
  • CompPoly/Multivariate/Unlawful.lean: This PR refactors the Unlawful multivariate polynomial type from a definition to an abbreviation and updates the coefficient type R to be universe polymorphic. It also generalizes the add_getD? lemma to require only an AddZeroClass instance and adjusts internal reducible attributes to improve elaborator performance. No sorry or admit placeholders were introduced.
  • CompPoly/Multivariate/VarsDegrees.lean: This change generalizes the universe level of the type parameter R from Type to Type*. This allows the definitions and lemmas in the file to be used with types in any universe level rather than being restricted to Type 0.
  • CompPoly/ToMathlib/MvPolynomial/Equiv.lean: This change applies the backward.isDefEq.respectTransparency configuration option to the support_finSuccEquivNth theorem to adjust how definitional equality is handled during proof elaboration. It does not introduce new theorems or sorry placeholders.
  • CompPoly/Univariate/Quotient/Core.lean: This refactors several proofs in the polynomial quotient implementation by replacing manual rewrites of quotient equality with the more idiomatic Quotient.sound. These changes simplify the proofs for operational "descending" lemmas (such as addition, multiplication, and power) without introducing new definitions or theorems.
  • lakefile.lean: This update bumps the versions of the mathlib and ExtTreeMapLemmas dependencies to align the project with the v4.29.0-rc6 release cycle.
  • tests/CompPolyTests/Univariate/Linear.lean: This update marks custom BEq Nat instances as reducible and modifies the associated lawfulness proofs to use erw for more explicit unfolding. The changes refine existing internal proofs without introducing new theorems or sorry placeholders.
  • CompPoly/Univariate/Raw/Proofs.lean: This update modifies the proof of equiv_mul_one by replacing the lemma Array.sum_eq_sum_toList with Array.sum_toList. The change aligns the theorem's proof with the current naming conventions or API of the underlying library.
  • CompPoly/Fields/Binary/Tower/Concrete/Algebra.lean: This update marks ConcreteBTFieldAlgebra and binaryTowerModule as reducible and adjusts a transparency option to improve definition unfolding during unification and typeclass resolution. These changes are intended to facilitate proof automation and typeclass inference for the binary tower field algebra without introducing new theorems or sorry placeholders.
  • CompPoly/Fields/Binary/Tower/Abstract/Algebra.lean: This update refines proofs involving towerAlgebraMap by using erw to better handle type casts and marks binaryAlgebraTower and binaryTowerModule as @[reducible] to facilitate typeclass resolution. The changes modify existing proofs and definitions without introducing new theorems or sorry placeholders.

Last updated: 2026-04-09 11:02 UTC.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 28, 2026

Build Timing Report

  • Commit: 7a96fdc
  • Message: Merge 571ee1d into 19daa9e
  • Ref: dhsorens/bump_to_4.29.0-rc6
  • Comparison baseline: ba504dc from the previous successful PR update.
  • Measured on ubuntu-latest with /usr/bin/time -p.
  • Commands: clean build rm -rf .lake/build && lake build; warm rebuild lake build; test path lake test.
Measurement Baseline (s) Current (s) Delta (s) Status
Clean build 241.75 245.34 +3.59 ok
Warm rebuild 1.71 1.68 -0.03 ok
Test path 15.94 16.51 +0.57 ok

Incremental Rebuild Signal

  • Warm rebuild saved 243.66s vs clean (146.04x faster).

This compares a clean project build against an incremental rebuild in the same CI job; it is a lightweight variability signal, not a full cross-run benchmark.

Slowest Current Clean-Build Files

Showing 20 slowest current targets, with comparison against the selected baseline when available.

Current (s) Baseline (s) Delta (s) Path
58.00 58.00 +0.00 CompPoly/Fields/Binary/BF128Ghash/XPowTwoPowModCertificate.lean
53.00 55.00 -2.00 CompPoly/Fields/Binary/Tower/Abstract/Basis.lean
49.00 45.00 +4.00 CompPoly/Bivariate/ToPoly.lean
29.00 28.00 +1.00 CompPoly/Fields/Binary/BF128Ghash/Impl.lean
26.00 26.00 +0.00 CompPoly/Univariate/Raw/Proofs.lean
25.00 23.00 +2.00 CompPoly/Univariate/Lagrange.lean
22.00 20.00 +2.00 CompPoly/Fields/Binary/AdditiveNTT/NovelPolynomialBasis.lean
21.00 22.00 -1.00 CompPoly/Fields/Binary/Tower/Support/Preliminaries.lean
16.00 16.00 +0.00 CompPoly/Fields/Binary/AdditiveNTT/Correctness.lean
16.00 13.00 +3.00 CompPoly/Univariate/Quotient/Core.lean
15.00 17.00 -2.00 CompPoly/Fields/Binary/AdditiveNTT/Intermediate.lean
15.00 13.00 +2.00 CompPoly/Fields/Binary/Tower/Abstract/Core.lean
14.00 14.00 +0.00 CompPoly/Fields/Binary/AdditiveNTT/Domain.lean
13.00 11.00 +2.00 CompPoly/Univariate/Basic.lean
12.00 9.00 +3.00 CompPoly/Multilinear/Basic.lean
11.00 4.00 +7.00 CompPoly/Fields/Binary/Tower/TensorAlgebra.lean
10.00 9.10 +0.90 CompPoly/Fields/PrattCertificate.lean
10.00 6.60 +3.40 CompPoly/Fields/Binary/Common.lean
9.50 10.00 -0.50 CompPoly/Multivariate/Unlawful.lean
9.40 10.00 -0.60 CompPoly/Fields/Binary/BF128Ghash/XPowTwoPowGcdCertificate.lean

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 28, 2026

🤖 Initial AI review without external context

🤖 AI Review

Overall Summary:

Executive Summary

1. TL;DR:
The PR effectively implements necessary universe polymorphism updates (e.g., using Type*) and excellent proof maintenance across the codebase. However, changes are requested to address technical debt introduced by global definitional equality overrides and unidiomatic uses of definition transparency attributes.

2. Checklist Coverage:
No explicit specification checklist was provided for this PR.

(Note: The "Critical Misformalizations" section has been omitted as the underlying mathematics and proofs are sound across all files.)

3. Key Lean 4 / Mathlib Issues:

  • Global Definitional Equality Overrides (2 files):
    Adding set_option backward.isDefEq.respectTransparency false at the top level alters the definitional equality checker for the entire file, ignoring definition transparency. This is an anti-pattern that can cause severe performance degradation, timeouts, and brittle proofs.

    • Action: Resolve the underlying definitional equality failures (e.g., by ensuring type aliases have the correct transparency or using unfold/dsimp). If this option is strictly necessary as a temporary hack for toolchain migration, localize it to the failing declarations using set_option ... in or add a -- TODO: comment to track the technical debt.
    • Affected files: CompPoly/Fields/Binary/Tower/Concrete/Algebra.lean, CompPoly/Fields/Binary/Tower/Equiv.lean. (Note: This workaround was also noted locally in Abstract/Basis.lean and Support/Preliminaries.lean; please add explanatory comments to these localized instances).
  • Unidiomatic @[reducible] def Usage (3 files):
    Lean 4 provides the abbrev keyword, which is the strictly preferred, idiomatic way to declare reducible definitions or typeclass aliases. Furthermore, applying @[reducible] def to a Prop (like IsScalarTower) is ineffective due to proof irrelevance and should simply be a lemma or theorem.

    • Action: Replace @[reducible] def with abbrev for data/typeclass definitions, and with lemma/theorem for propositions.
    • Affected files: CompPoly/Fields/Binary/Tower/Abstract/Basis.lean (Prop issue), CompPoly/Data/RingTheory/AlgebraTower.lean (use abbrev), CompPoly/Fields/Binary/Tower/Concrete/Algebra.lean (use abbrev).

4. Minor Nitpicks & Polish:

  • Duplicate Instances: CompPoly/Fields/Binary/Tower/Concrete/Field.lean contains two identical Fintype (ConcreteBTField k) instances right next to each other. Please delete the unnamed one to prevent typeclass resolution confusion.
  • Tactical Cleanups:
    • In CompPoly/Data/RingTheory/AlgebraTower.lean, there are pre-existing unidiomatic uses of := by exact .... These can be cleaned up by supplying the exact term directly.
    • In tests/CompPolyTests/Univariate/Linear.lean, using erw [show ... from rfl] is a bit hacky for forcing definitional reduction. Consider using the change tactic to update the goal to its reduced form before applying simp.

5. Overall Verdict:
Changes Requested


📄 **Review for `CompPoly/Bivariate/ToPoly.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Data/Nat/Bitwise.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Data/Polynomial/Frobenius.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Data/RingTheory/AlgebraTower.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:

  • Use abbrev instead of @[reducible] def: In Lean 4, it is highly idiomatic to use the abbrev keyword for definitions that you want to be reducible, rather than attaching the @[reducible] attribute to a def. You can cleanly replace:

    @[simp, reducible]
    def AlgebraTower.toAlgebra {i j : ι} (h : i ≤ j) : Algebra (A i) (A j) :=
      (AlgebraTower.algebraMap (i:=i) (j:=j) (h:=h)).toAlgebra

    with:

    @[simp]
    abbrev AlgebraTower.toAlgebra {i j : ι} (h : i ≤ j) : Algebra (A i) (A j) :=
      (AlgebraTower.algebraMap (i:=i) (j:=j) (h:=h)).toAlgebra

    This applies similarly to toAlgebraOverLeft and toAlgebraOverRight.

  • Unidiomatic by exact: In AlgebraTowerEquiv.toAlgebraOverLeft and toAlgebraOverRight, the definitions use := by exact .... This is unidiomatic (though pre-existing); you can supply the term directly without entering tactic mode:

    abbrev AlgebraTowerEquiv.toAlgebraOverLeft (e : AlgebraTowerEquiv A B) (i j : ι)
        (h : i ≤ j) : Algebra (A i) (B j) :=
      (e.algebraMapRightUp i j h).toAlgebra
📄 **Review for `CompPoly/Data/Vector/Basic.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/AdditiveNTT/Correctness.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/AdditiveNTT/Impl.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/AdditiveNTT/Intermediate.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/AdditiveNTT/NovelPolynomialBasis.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/BF128Ghash/Basic.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/Common.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/Tower/Abstract/Algebra.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/Tower/Abstract/Basis.lean`**

Verdict: Changes Requested

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:

  • Unidiomatic use of @[reducible] def for a Prop: The typeclass IsScalarTower is a Prop in Mathlib. Because of proof irrelevance, its terms are proofs, meaning that definitional equality transparency (e.g., @[reducible]) has no effect on them. It is unidiomatic to use @[reducible] def for a proposition; it should simply be a lemma or theorem.
    lemma BTField.isScalarTower_succ_right (l r : ℕ) (h_le : l ≤ r) : 
        IsScalarTower (BTField l) (BTField r) (BTField (r+1)) :=
      instAlgebraTowerNatBTField.toIsScalarTower (i:=l) (j:=r) (k:=r+1)
      (h1:=by omega) (h2:=by omega)

Nitpicks:

  • Performance Workarounds: Increasing maxHeartbeats to 800000 and disabling backward.isDefEq.respectTransparency are strong indicators that the unifier is struggling significantly with definitional equalities (likely due to the deep algebraic hierarchy and the casts across the dependent BTField types). While this is an acceptable localized workaround to force the proof through, it makes the code brittle. In the future, consider mitigating this by using AlgEquiv instead of Eq.rec/cast, which avoids pushing dependent type mismatches into the unification engine.
  • simp Configurations: The use of simp (config := { failIfUnchanged := false }) is fine as a tactical patch, but be aware that it can mask obsolete rewrite steps if the underlying math or instances change later.
📄 **Review for `CompPoly/Fields/Binary/Tower/Abstract/Split.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

(Note: The changes in this PR are entirely confined to proofs, addressing fragility by replacing convert and simp with more robust explicit refinement and rewriting. Since no theorem statements or mathematical definitions were modified, the formalization remains correct.)

📄 **Review for `CompPoly/Fields/Binary/Tower/Concrete/Algebra.lean`**

Verdict: Changes Requested

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:

  • Global set_option backward.isDefEq.respectTransparency false: Adding this option at the top of the file alters the behavior of the definitional equality checker for the entire file, forcing it to unfold definitions even when they are marked to prevent it. This is generally considered an anti-pattern in Lean 4 and Mathlib, as it can cause significant performance degradation (timeouts) and make proofs brittle.
    While sometimes necessary as a temporary hack to make cast and HEq goals work, you should ideally resolve the underlying definitional equality failures. You have already taken the right first steps by marking ConcreteBTFieldAlgebra and binaryTowerModule as @[reducible]. If this option is still strictly necessary for certain proofs to compile, please localize it to those specific declarations using set_option backward.isDefEq.respectTransparency false in rather than applying it globally to the file.

Nitpicks:

  • @[reducible] def vs abbrev: You correctly added @[reducible] to ConcreteBTFieldAlgebra and binaryTowerModule to ensure typeclass synthesis and definitional equality can see through them. Note that in Lean 4, using abbrev is completely equivalent to @[reducible] def and is the more idiomatic choice for typeclass aliases. For example:
    abbrev ConcreteBTFieldAlgebra {l r : ℕ} (h_le : l ≤ r) :
        Algebra (ConcreteBTField l) (ConcreteBTField r) := instAlgebraTowerConcreteBTF.toAlgebra h_le
📄 **Review for `CompPoly/Fields/Binary/Tower/Concrete/Basis.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/Tower/Concrete/Core.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/Tower/Concrete/Field.lean`**

Verdict: Needs Minor Revisions

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:

  • Duplicate Instances: The diff modifies two identical Fintype instances right next to each other. Having duplicate instances for the exact same type can occasionally confuse typeclass resolution or degrade performance. You should remove one of them (likely keep the named one instFintype or just the unnamed one, as they are functionally identical).
    noncomputable instance (k : ℕ) : Fintype (ConcreteBTField k) := (getBTFResult k).instFintype
    
    noncomputable instance instFintype {k : ℕ} : Fintype (ConcreteBTField k) :=
      (getBTFResult k).instFintype
    Consider deleting the first unnamed instance.
📄 **Review for `CompPoly/Fields/Binary/Tower/Equiv.lean`**

Verdict: Changes Requested

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:

  • Technical Debt / Migration Flag: The addition of set_option backward.isDefEq.respectTransparency false at the top of the file is strongly discouraged for long-term codebase health. This is a backward-compatibility flag introduced in Lean 4 to temporarily fix proofs that break when Lean became stricter about respecting definition transparency during definitional equality checks (isDefEq).
    • If you must use it for a quick toolchain migration: Please add a -- TODO: comment directly above the option to track this technical debt so it isn't forgotten.
    • Ideal Fix: You should fix the underlying proofs instead of relying on this global flag. This typically involves identifying which definitions Lean is struggling to unfold and ensuring they have the correct transparency (e.g., adding @[reducible] or abbrev to type synonyms/aliases) or explicitly using unfold or dsimp in the failing proofs.

Nitpicks:
None

📄 **Review for `CompPoly/Fields/Binary/Tower/Support/Preliminaries.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:

  • Consider adding a brief comment above set_option backward.isDefEq.respectTransparency false in explaining why this compiler directive is necessary (e.g., "Added to prevent deterministic timeouts in isDefEq during elaboration involving AdjoinRoot"). This is helpful for future maintainers to know when it might be safe to remove the option after a Lean compiler or Mathlib bump.
📄 **Review for `CompPoly/Multilinear/Basic.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

(The PR consists entirely of removing obsolete/unused lemmas like Fin.cast_succ_eq and Fin.val_succ from simp only calls, which is a standard maintenance task typically required after a Mathlib bump. The changes are minimal, isolated to proof scripts, and mathematically safe.)

📄 **Review for `CompPoly/Multilinear/Equiv.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/CMvMonomial.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/CMvPolynomial.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/CMvPolynomialEvalLemmas.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

Comments:
This is a straightforward and excellent change. Promoting R from Type (which restricts it to universe 0) to Type* makes the lemmas properly universe-polymorphic, matching the definition of CMvPolynomial. Good catch!

📄 **Review for `CompPoly/Multivariate/FinSuccEquiv.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/Lawful.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:

  • The generalization from Type to Type* across the file is a great improvement for universe polymorphism, as is the NzConst capitalization change to adhere to Lean 4 naming conventions.
  • The use of set_option allowUnsafeReducibility true is generally discouraged but occasionally necessary as a workaround for definitional equality issues with typeclasses (especially DecidableEq). Since it is applied with a local attribute, its blast radius is safely contained to this file.
📄 **Review for `CompPoly/Multivariate/MvPolyEquiv/Core.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/MvPolyEquiv/Eval.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/MvPolyEquiv/Instances.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

(The changes correctly address universe polymorphism by replacing Type with Type*, which is a best practice. Furthermore, the adjustments to the proof of map_mul — specifically the manual refolding of F₃ using change and the use of erw — are idiomatic and robust workarounds for the beta-reduction and definitional equality changes introduced in Lean 4.29.)

📄 **Review for `CompPoly/Multivariate/Operations.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/Rename.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/Restrict.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/Unlawful.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Multivariate/VarsDegrees.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/ToMathlib/MvPolynomial/Equiv.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `CompPoly/Univariate/Quotient/Core.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

(The changes correctly replace the unidiomatic rw [Quotient.eq]; simp [Raw.instSetoidCPolynomial] pattern with apply Quotient.sound, streamlining the proofs that operations descend to the quotient.)

📄 **Review for `CompPoly/Univariate/Raw/Proofs.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `lakefile.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:
None

📄 **Review for `tests/CompPolyTests/Univariate/Linear.lean`**

Verdict: Approved

Critical Misformalizations:
None

Lean 4 / Mathlib Issues:
None

Nitpicks:

  • Unidiomatic Rewriting: Using erw [show ... from rfl] is a bit of a hacky way to force definitional reduction. Since you already made natBeqEq and natBeqSucc @[reducible], you can simply use the change tactic to change the goal (or hypothesis) to its reduced form. For example, change decide (a = a) = true; simp is cleaner and more idiomatic than using erw with a show ... from rfl term. Since this is just a test file, it's completely fine as is, but change is generally preferred for definitional unfolding when simp or dsimp fail to do so automatically.

quangvdao and others added 2 commits March 31, 2026 21:43
* refactor(multivariate): generalize coefficient universes

* refactor(multivariate): restore ExtTreeMap lemmas dependency

* style(multivariate): clean review nits

* fix(multivariate): adapt universe branch to Lean 4.29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants